<?php

namespace App\Http\Models\Admin\Street;

use Illuminate\Database\Eloquent\Model;

class Street extends Model
{
    //
    protected $table="street_list";
    protected $fillable = [
        'name'
    ];

    // 街道关联街道负责人表
    public function hasManyStreetPersonnel()
    {
        //关联的模型类名, 关系字段
        return $this->belongsToMany('App\Http\Models\Admin\Member\Street','street_has_street_personnel','street_id','personnel_id');
    }

    // 街道关联部门负责人表
    public function hasManyDepartment()
    {
        //关联的模型类名, 关系字段
        return $this->belongsToMany('App\Http\Models\Admin\Member\Department','street_has_department_personnel','street_id','personnel_id');
    }
}
